package com.photography.entity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import jakarta.persistence.Temporal;
import jakarta.persistence.TemporalType;
import lombok.Data;

@Data
@TableName("orders")
@JsonInclude(JsonInclude.Include.NON_NULL) // 只包含非空字段
public class Order implements Serializable {

    @TableId(value = "order_id", type = IdType.AUTO)
    private Integer orderId;

    private Integer userId;

    private Integer addressId;

    /**
     * 拍摄时间
     */
    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date shootingTime;

    /**
     * 拍摄地点
     */
    private String shootingLocation;

    /**
     * 订单金额
     */
    private BigDecimal orderAmount;

    /**
     * 支付方式
     */
    private String paymentMethod;



    /**
     * 订单状态
     */
    private String orderStatus;

    @Temporal(TemporalType.TIMESTAMP)
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date orderCreateTime;

    @TableField(exist = false)  // 非数据库字段
    private List<OrderItem> orderItemList;

    @TableField(exist = false)
    private ShippingAddress ShippingAddress;


}
